package discovery

import (
	"context"
	"google.golang.org/grpc"
)

type Conn interface {
	GetConns(ctx context.Context, serviceName string, opts ...grpc.DialOption) ([]*grpc.ClientConn, error)
	GetConn(ctx context.Context, serviceName string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
	GetSelfConnTarget() string
	AddOption(opts ...grpc.DialOption)
	CloseConn(conn *grpc.ClientConn)
	// do not use this method for call rpc
}

type Registry interface {
	Conn
	Register(serviceName, host string, port int, opts ...grpc.DialOption) error
	UnRegister() error
	Close()
	GetUserIdHashGatewayHost(ctx context.Context, userId string) (string, error)
}

type SvcDiscoveryRegistry Registry
